package dk.sdu.amaze;
import java.applet.Applet;
import java.applet.AudioClip;
import java.net.URL;
import java.util.HashMap;

public class Stored_sounds {
	@SuppressWarnings("unchecked")
	public static HashMap<String, AudioClip> hashMapSounds;
	private static String[] titles = {
			"start.wav",
			"move.wav",
			"bomb.wav",
			"time finished.wav",
			"finish1.wav",
			"chooseL.wav",
			"gongg.wav",
			"logo.wav"
			};
	private static AudioClip audioClip;
	private static URL url;

	// extremely ugly
	static {
		hashMapSounds = new HashMap<String, AudioClip>(titles.length);

		for(int i = 0; i< titles.length; i++)
		{
			url = Stored_sounds.class.getResource(titles[i]);
			audioClip = Applet.newAudioClip(url);
			hashMapSounds.put(titles[i], audioClip);
		}
	}

//	@SuppressWarnings("unchecked")
//	Stored_sounds()
//	{
//		 hashMapSounds = new HashMap(titles.length);
//		 allocate();
//	}
//	@SuppressWarnings("unchecked")
//	private void allocate()
//	{
//		for(int i = 0; i< titles.length; i++)
//		{
//			url = getClass().getResource(titles[i]);
//			audioClip = Applet.newAudioClip(url);
//			hashMapSounds.put(titles[i], audioClip);
//		}
//	}

}
